#!/usr/bin/env python

import wx

import resource as r

class MenuBar(wx.MenuBar):
    '''MenuBar class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 10:47 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.MenuBar.__init__(self, *args, **kwargs)
        self.file = File()
        self.Append(self.file, r.string.menu.main.file.label)
        self.data = Data()
        self.Append(self.data, r.string.menu.main.data.label)
        self.help = Help()
        self.Append(self.help, r.string.menu.main.help.label)

class File(wx.Menu):
    '''File class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 09:54 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.close = wx.MenuItem(self, -1, r.string.menu.file.quit.label,
                                 r.string.menu.file.quit.help)
        self.close.Bitmap = r.toolbar.DoorOpenOut.Bitmap
        self.AppendItem(self.close)

class Data(wx.Menu):
    '''Data class
    
    @author Julot <andy.julot@gmail.com>
    @since Monday, February 20, 2012. 01:09 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.start = wx.MenuItem(self, -1, r.string.menu.data.start.label,
                                 r.string.menu.data.start.help)
        self.start.Bitmap = r.toolbar.Control.Bitmap
        self.AppendItem(self.start)
        
        self.stop = wx.MenuItem(self, -1, r.string.menu.data.stop.label,
                                r.string.menu.data.stop.help)
        self.stop.Bitmap = r.toolbar.ControlStopSquare.Bitmap
        self.AppendItem(self.stop)
        self.stop.Enable(False)

class Help(wx.Menu):
    '''Help class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 10:48 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.index = wx.MenuItem(self, -1, r.string.menu.help.index.label,
                                 r.string.menu.help.index.help)
        self.index.Bitmap = r.toolbar.QuestionButton.Bitmap
        self.AppendItem(self.index)
        
        self.AppendSeparator()
        
        self.about = wx.MenuItem(self, -1, r.string.menu.help.about.label,
                                 r.string.menu.help.about.help)
        self.about.Bitmap = r.toolbar.About.Bitmap
        self.AppendItem(self.about)
        